www.gusucode.com > 基于Matlab的MIMO通信系统仿真 含报告;司中威;了解移动通信 > 基于Matlab的MIMO通信系统仿真 含报告;司中威;了解移动通信关键技术,了解数字通信系统仿真流程,实现基本的信道编译码、调制解调等通信模块。(好评如潮,课设拿满) 学习并实现MIMO空时处理技术 学习性能分析的思路和方法/mimo/matlab for mimo 2x2/channel_sim.m
% Channel % By Maxime Maury % 05-04-22 clear all; close all; disp('Start channel_sim') load('TXOutput'); load('tx_param'); % Length of the stream channel_len = size(Channel1,2); % Downconvert from 10 kHz to 0 Hz Channel1dn = [ upconv_cos(Channel1, Fc_tx, Fs, 0, 0) + j* upconv_sin(Channel1, Fc_tx, Fs, 0, 0)]; Channel2dn = [ upconv_cos(Channel2, Fc_tx, Fs, 0, 0) + j* upconv_sin(Channel2, Fc_tx, Fs, 0, 0)]; [b,a] = cheby2(8,16, (2.47/2*Fc/Fs)*2,'low'); Channel1dn = filter(b,a,Channel1up); Channel2dn = filter(b,a,Channel2up); % Multiplying 2 times by cos lower half the amplitude of the signal Channel1dn = 2 * Channel1dn; Channel2dn = 2 * Channel2dn; % Channel Matrix % H = sqrt(1/2)*ones(4,2); H = [1 0; 1 0; 0 1; 0 1]; % H = sqrt(1/2)*randn(4,2) + j*sqrt(1/2)*randn(4,2); % H =[-0.8247+0.0672i -0.2265-0.5771i; 1.2417-0.5251i -1.1163-0.8573i; 0.0160+0.1416i -0.3327+0.0468i; -0.3825+0.3055i 1.1659+0.6654i]; % Generate the data streams at the receive antennas S = [Channel1up; Channel2up]; % Where the frames start frame_start = init_len + time_end + 1; % There is a sinusoid of length time_end + 1 Y = H*S(:,1:frame_start-1); % Proceed frame by frame for fr = 1:nr_frames % H = H + 1/1000*(sqrt(1/2)*randn(4,2) + j*sqrt(1/2)*randn(4,2)); Y = [Y H*S(:,(fr-1)*Lf + frame_start:fr*Lf+frame_start + 1)]; end Y = [Y H*S(:,fr*Lf+frame_start+2:end)]; % AWGN SNR_dB = 34; %dB % Compute Es s = frame_start; e = s + Lf*nr_frames - 1; % plot(abs(Channel1up(1,s:e))); Es = sum(abs(Channel1up(1,s:e))^2)/((e-s+1)/L); figure; Nc = 2; Nr = 2; subplot(Nr,Nr,1); plot(Channel1up(1, frame_start-1),'r'); hold on; plot(Channel1up(:,(fr-1)*Lf + frame_start:fr*Lf+frame_start + 1)); sigma_sqr = Es / 10^(SNR_dB/10); Noise = sqrt(sigma_sqr/2) * ( randn(4,channel_len) + j*randn(4,channel_len)); Y_n = Y + Noise; % Upconvert for k=1:4 Y_R(k,:) = upconv(real(Y_n(k,:)), imag(Y_n(k,:)), Fc_tx, Fs, 0); end % figure('Name','Channel') % plot(Channel1(:),'r');% % hold on; % plot(Y_R(1,:),'g') % legend('Channel1', 'Channel A=1') deviation = std(Y_n(1,:)-Y(1,:)); SNR = 10*log10(Es/(deviation^2)) save('ChannelOutput','Y_R'); disp('End') % figure('Name','Low Pass Filter'); % freqz(b,a,512,Fs);